with open("静夜思.txt","r",encoding="utf-8") as f1:
    data = f1.read()
with open("静夜思1.0.txt","w") as f2:
    data1 = data.split(" ")#以空格分割
    for i in data1:
        f2.write(i)
        f2.write("\n")#换行

with open("静夜思1.0.txt", "r") as f3:
    d1 = f3.readline()#读取第一行
    d2 = f3.readline()  # 读取第二行
    d3 = f3.read()  # 读取所有行
with open("静夜思2.0.txt", "w") as f4:
    f4.write("    "+d1)
    f4.write("唐朝  "+d2)
    f4.write(d3)

with open("绝句.txt", encoding="utf-8") as f1:
    with open("绝句1.0.txt", "w") as f2:
        for i in f1.readlines():
            if i != "\n":
                f2.write(i)
